<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

</body>
<script>


    function wrap() {
         var a="a-val";
         function inner() {
             console.log(a);
         }
         inner();
     }

     wrap();

</script>
</html>